﻿using Furion.DatabaseAccessor;
using Gear.Core.Locator.TenantDbContext;
using Gear.ORM.Core.Tenant;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gear.EntityFramework.Core
{
    public class TenantSeedData : IEntitySeedData<Tenants, MultiTenantDbContextLocator>
    {
        public IEnumerable<Tenants> HasData(DbContext dbContext, Type dbContextLocator)
        {
            return new List<Tenants>
            {
                new Tenants
                {
                    TenantId = Guid.NewGuid().ToString(),
                    Name = "默认租户",
                    Host = "0.0.0.1:5000",
                    CreatedTime = DateTime.Now,
                    Schema = "gear" // Schema
                },
                new Tenants
                {
                    TenantId = Guid.NewGuid().ToString(),
                    Name = "其他租户",
                    Host = "0.0.0.1:1000",
                    CreatedTime = DateTime.Now,
                    Schema = "other" // Schema
                }
            };
        }
    }
}
